<?php

/**
 * This is the model class for table "agent_related".
 *
 * The followings are the available columns in table 'agent_related':
 * @property integer $id ID
 * @property string $provider_id 供应商id
 * @property string $dealer_id 经销商id
 * @property string $status Status
 */
class AgentRelated extends ActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return AgentRelated the static model class
	 */
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	
	public function getMdcClass() {
		return 'application.models.metadata.AgentRelatedMetadata';
	}
	
	public function related($dealerId, $providerId) {
		return $this->findByAttributes(array(
			'dealer_id' => $dealerId,
			'provider_id' => $providerId
		));
	}
}